package com.cenluan.beetl;

import org.apache.commons.lang3.StringEscapeUtils;
import org.beetl.core.Format;

public class XSSDefenseFormat implements Format {

	public Object format(Object data, String pattern) {

		if (null == data) {
			return null;
		} else {
			return StringEscapeUtils.escapeHtml4((String) data);
		}
	}
}